package com.aboverock.core.security.enums;

/**
 * 用户安全日志类型 枚举类型.
 *
 * @author Rock Wang
 */
public enum SecurityTypeEnum {

    /** 用户锁定(12). */
    USER_LOCK(12, "{\"zh\":\"锁定用户\",\"en\":\"Lock Account\"}"),

    /** 用户解锁(13). */
    USER_UNLOCK(13, "{\"zh\":\"解锁用户\",\"en\":\"Unlock Account\"}"),

    /** 用户删除(14). */
    USER_DELETE(14, "{\"zh\":\"删除用户\",\"en\":\"Delete Account\"}");

    private final Integer value;

    /** 描述 String型. */
    private final String description;

    SecurityTypeEnum(Integer value, String description) {
        this.value = value;
        this.description = description;
    }

    /**
     * 获取值.
     *
     * @return value
     */
    public Integer getValue() {
        return value;
    }

    /**
     * 获取描述信息.
     *
     * @return description
     */
    public String getDescription() {
        return description;
    }

    /**
     * Gets the security type.
     *
     * @param value the value
     * @return the security type
     */
    public static SecurityTypeEnum getSecurityType(Integer value) {
        if (null == value) {
            return null;
        }
        for (SecurityTypeEnum type : SecurityTypeEnum.values()) {
            if (value.equals(type.getValue())) {
                return type;
            }
        }
        return null;
    }

}